package com.sdgakj.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "f_order_pay")
public class OrderPay extends IdEntity {
	
	private static final long serialVersionUID = 1L;
    /** 状态(0未支付 1支付成功 2支付失败 ) */
	private Integer state = 0;
    // 用户ID
    private Long userId;
    // 支付类型
    private Integer type;
    // 支付渠道返回的交易流水号
    private String transactionNo;
    // 第三方支付随机数
    private String nonceStr;
    // 第三方支付prepay_id
    private String prepayId;
    // 支付账号
    private String account;
    /** 支付时间 */
    private Date payTime;

    private Double amount;

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    private String openid;

    public Long getDonationId() {
        return donationId;
    }

    public void setDonationId(Long donationId) {
        this.donationId = donationId;
    }

    /** 商品表id */
    private Long donationId;

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    public Date getPayTime() {
        return payTime;
	}

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
	}

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTransactionNo() {
        return transactionNo;
    }

    public void setTransactionNo(String transactionNo) {
        this.transactionNo = transactionNo;
    }

    public String getNonceStr() {
        return nonceStr;
    }

    public void setNonceStr(String nonceStr) {
        this.nonceStr = nonceStr;
    }

    public String getPrepayId() {
        return prepayId;
    }

    public void setPrepayId(String prepayId) {
        this.prepayId = prepayId;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }
    public Double getAmount() {  return amount;}

    public void setAmount(Double amount) {this.amount = amount;}
	
}
